<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

    <div>

        <button id="btnDelete">猛如虎的操作</button>

    </div>

    <script>

        function MyObject(counts = 10) {
            for (let i = 0; i < counts; i++) {
                this[i] = `${i}-${Math.random()}`;
            }
        }

        var foo = new MyObject();

        document.getElementById("btnDelete").addEventListener("click", () => {
            actions();
            console.log("actions", " done");
        })

        function actions() {
            foo[100000] = `${100000}-${Math.random()}`;
            foo[100] = `${100}-${Math.random()}`;
            delete foo[9];
            foo[2] = `2-${Math.random()}`;
        }


    </script>
</body>
</html>

